<template>
  <div class="video-item">
    <a-card :title="video.title" style="width: 300px">
      <div class="content">
        <div class="left" @click="showVideo">
          <div class="play">
            <a-icon type="caret-right" />
          </div>
        </div>
        <div class="right">
          <div class="bottom">
            <p>{{ video.realname }}</p>
            <p>{{ format }}</p>
          </div>
        </div>
      </div>
    </a-card>
  </div>
</template>

<script>
import { formatTime } from "../../formatTime";
export default {
  props: ["video"],
  data() {
    return {};
  },
  computed: {
    format() {
      console.log(this.video.time);
      return formatTime(this.video.time * 1);
    },
  },
  methods: {
    showVideo(){
      console.log(this.video.prod)
      this.$emit("sendSrc",this.video.prod)
    }
  },
};
</script>

<style lang="less" scoped>
.video-item{
  margin-right: 16px;
}
.content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  .left {
    position: relative;
    transition: all 0.3s;
    width: 100px;
    height: 100px;
    border-radius: 50%;
      background-color: rgba(0, 0, 0, 0.6);
    .play {
      transition: color 0.4s;
      i {
        border-radius: 50%;
        left: 4px;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        position: absolute;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 65px;
      }
      &:hover {
        color: red;
      }
    }
    &:hover {
      transform: scale(1.04);
      scale: 1.4;
      box-shadow: 0 0 6px 4px rgba(0, 0, 0, 0.7) inset;
    }
  }
  .right {
    img {
      width: 50px;
      height: 50px;
      border-radius: 50%;
    }
    .bottom {
      font-size: 12px;
      color: rgba(0, 0, 0, 0.3);
      p {
        margin: 15px 0;
        &:nth-child(1) {
          font-size: 19px;
          color: #555;
        }
      }
    }
  }
}
</style>
